<!DOCTYPE html>
<html lang="en">
  
  <head>
    <meta charset="utf-8" />
    <title>DocSearch playground</title>
    <link rel="stylesheet" href="./bootstrap.min.css" />
    <link rel="stylesheet" href="http://127.0.0.1:8080/docsearch.min.css" />
  </head>
  
  <body>
    <div class="container">
      <div class="mt-1">
        <h1>Assets are served from http://127.0.0.1:8080/ </h1>
      </div>
      <div class="col-md-12">
        <div class="input-group">
          <input type="search" placeholder="DocSearch input" class="form-control" id="q">
        </div>
      </div>
    </div>
    <!-- at the end of the BODY -->
    <script src="http://127.0.0.1:8080/docsearch.js"></script>
    <script src="./fuse.min.js"></script>
    <script>

      // var testIndex = elasticlunr(function () {
      //   this.addField('title');
      //   this.addField('content');
      //   this.setRef('id');
      // });

      var content = "UGFyY2Vs4oCZcyBwcm9kdWN0aW9uIG1vZGUgYXV0b21hdGljYWxseSBidW5kbGVzIGFuZCBvcHRpbWl6ZXMgeW91ciBhcHBsaWNhdGlvbiBmb3IgcHJvZHVjdGlvbi4gSXQgY2FuIGJlIHJ1biB1c2luZyB0aGUgcGFyY2VsIGJ1aWxkIGNvbW1hbmQ6CnBhcmNlbCBidWlsZCBzcmMvaW5kZXguaHRtbApTaXplIG9wdGltaXphdGlvbgojUGFyY2VsIGluY2x1ZGVzIG1hbnkgb3B0aW1pemF0aW9ucyBkZXNpZ25lZCB0byByZWR1Y2UgYnVuZGxlIHNpemVzLCBpbmNsdWRpbmcgYXV0b21hdGljIG1pbmlmaWNhdGlvbiwgdHJlZSBzaGFraW5nLCBpbWFnZSBvcHRpbWl6YXRpb24sIGFuZCBtb3JlLgpNaW5pZmljYXRpb24KI1BhcmNlbCBpbmNsdWRlcyBtaW5pZmllcnMgZm9yIEphdmFTY3JpcHQsIENTUywgSFRNTCwgYW5kIFNWRyBvdXQgb2YgdGhlIGJveC4gTWluaWZpY2F0aW9uIHJlZHVjZXMgdGhlIGZpbGUgc2l6ZSBvZiB5b3VyIG91dHB1dCBidW5kbGVzIGJ5IHJlbW92aW5nIHdoa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ZSBhbmFseXplciBvbiBldmVyeSBidWlsZCBhdXRvbWF0aWNhbGx5LgpCdW5kbGUgQnVkZHkKI1RoZSBAcGFyY2VsL3JlcG9ydGVyLWJ1bmRsZS1idWRkeSBwbHVnaW4gY2FuIGJlIHVzZWQgdG8gZ2VuZXJhdGUgYSByZXBvcnQgdGhhdCBpcyBjb21wYXRpYmxlIHdpdGggQnVuZGxlIEJ1ZGR5LiBZb3UgY2FuIHJ1biBpdCB1c2luZyB0aGUgLS1yZXBvcnRlciBDTEkgb3B0aW9uLgpwYXJjZWwgYnVpbGQgc3JjL2luZGV4Lmh0bWwgLS1yZXBvcnRlciBAcGFyY2VsL3JlcG9ydGVyLWJ1bmRsZS1idWRkeQpOb3cgdXBsb2FkIHRoZSBmaWxlcyBpbiB0aGUgZGlzdCBkaXJlY3RvcnkgdG8gdGhlIEJ1bmRsZSBCdWRkeSB3ZWJzaXRlLgoKCgo=";

      let str = atob(content);

      var doc1 = {
        "id": 1,
        "content": "Yestaday Oracle has released its new database Oracle 12g, this would make more money for this company and lead to a nice profit report of annual year.",
        "url": "http://www.baidu.com",
        "hierarchy": {
          "lvl0": "Foo",
          "lvl1": "Bar",
          "lvl2": "Oracle released its latest database Oracle 12g"
        }
      }

      var doc2 = {
        "id": 2,
        "content": "As expected, Oracle released its profit report of 2015, during the good sales of database and hardware, Oracle's profit of 2015 reached 12.5 Billion.",
        "url": "http://www.bing.com",
        "hierarchy": {
          "lvl0": "Foo",
          "lvl1": "AnotherBar",
          "lvl2": "Oracle released its profit report of 2015"
        }
      }

      var doc3 = {
        "id": 3,
        "content": str,
        "url": "http://www.bing.com",
        "hierarchy": {
          "lvl0": "features",
          "lvl1": "Production",
          "lvl2": "Production"
        }
      }

      const testIndex = new Fuse([
        doc1, doc2, doc3
      ], {
        keys: ['content'],
        threshold: 0.4,
      });

      // testIndex.addDoc(doc1);
      // testIndex.addDoc(doc2);
      // testIndex.addDoc(doc3);

      console.log(testIndex.search('"libr'));

      docsearch({
        indexName: 'docsearch',
        inputSelector: '#q',
        getIndex: function() {
          return testIndex;
        },
        queryDataCallback: function(data) {
          data.map(item => item.doc = item.item);
        },
        handleSelected(input, event, suggestion, datasetNumber, context) {
          console.info(input);
          console.info(event);
          console.info(suggestion);
          console.info(datasetNumber);
          console.info(context);
        },
        debug: true // Set debug to true if you want to inspect the dropdown
      });
    </script>
    <style>

      .container {
        margin: 10%;
      }

      .input-group {
        width: 60%;
        margin: auto;
        margin-top: 10%;
      }
    </style>
  </body>

</html>
